<template>
  <view class="my-manor">
    <view class="add-wrap">
      <view class="title">庄园信息</view>
      <view class="wrap rbox box_center" @tap="goPage('myManorEdit')">
        <view class="iconfont icon-add rbox box_center"></view>
      </view>
    </view>

    <view class="icon-wrap rbox box_center">
      <view class="iconfont icon-down"></view>
    </view>

    <view class="list-wrap">
      <view class="title">庄园信息</view>
      <view class="list cbox">
        <view class="item rbox" v-for="(item, idx) in list" :key="idx">
          <view class="info cbox boxf_1">
            <view class="l rbox">
              <text class="tit">庄园名称：</text>
              <text class="msg">{{ item.name }}</text>
            </view>
            <view class="l rbox">
              <text class="tit">庄园地址：</text>
              <text class="msg">{{ item.address }}</text>
            </view>
          </view>
          <view class="option cbox box_y_center">
            <text class="edit">编辑</text>
            <view class="radio rbox box_center" @tap="changeIndex(idx)">
              <view v-show="idx == activeIndex" class="iconfont icon-ok"></view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: 0,
      list: [
        {
          name: '第三农庄葡萄庄',
          address: '北京市海淀区海淀镇海淀街道'
        },
        {
          name: '第三农庄葡萄庄',
          address: '北京市海淀区海淀镇海淀街道'
        }
      ]
    }
  },
  methods: {
    goPage(url) {
      if (url) {
        wx.navigateTo({
          url: `/pages/${url}/${url}`
        })
      }
    },
    changeIndex(idx) {
      this.activeIndex = idx
    }
  }
}
</script>

<style lang="scss" scoped>
.my-manor {
  padding: 40rpx 42rpx 0;
  min-height: 100vh;
  background-color: #f7f7f7;
  .title {
    padding: 28rpx 30rpx;
    font-size: 34rpx;
    line-height: 1;
    color: #5a5a5a;
    border-bottom: 1rpx solid #e9e8e8;
  }
  .add-wrap {
    padding: 0 10rpx 88rpx;
    background: #ffffff;
    box-shadow: 0px 0px 6rpx rgba(0, 0, 0, 0.16);
    border-radius: 30rpx;
    .wrap {
      margin: 80rpx 0 0;
      .iconfont {
        width: 116rpx;
        height: 116rpx;
        background: #1de1c3;
        border-radius: 50%;
        font-size: 58rpx;
        color: #fff;
      }
    }
  }
  .icon-wrap {
    margin-top: 15rpx;
    .icon-down {
      font-size: 30rpx;
    }
  }
  .list-wrap {
    margin-top: 40rpx;
    padding: 0 10rpx 88rpx;
    min-height: 600rpx;
    background: #ffffff;
    box-shadow: 0px 0px 6rpx rgba(0, 0, 0, 0.16);
    border-radius: 30rpx;
    .list {
      padding: 0 15rpx;
      .item {
        padding: 24rpx 12rpx;
        border-bottom: 1rpx solid #e9e8e8;
        .info {
          .l {
            &:not(:first-child) {
              margin-top: 15rpx;
            }
            .tit {
              min-width: 6em;
              font-size: 26rpx;
              line-height: 1;
              color: #b5b5b5;
            }
            .msg {
              margin-left: 40rpx;
              font-size: 26rpx;
              line-height: 1.4;
              color: #5a5a5a;
            }
          }
        }
        .option {
          margin-left: 10rpx;
          .edit {
            font-size: 24rpx;
            line-height: 1;
            color: #c4c4c4;
          }
          .radio {
            margin-top: 15rpx;
            width: 34rpx;
            height: 34rpx;
            background-color: #e9e9e9;
            border-radius: 50%;
            .iconfont {
              font-size: 18rpx;
              color: #707070;
            }
          }
        }
      }
    }
  }
}
</style>